package com.ruoyi.environment.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import cn.hutool.core.util.IdUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.core.utils.SecurityUtils;
import com.ruoyi.environment.mapper.OpmEnvFirmWasteMapper;
import com.ruoyi.environment.domain.OpmEnvFirmWaste;
import com.ruoyi.environment.service.IOpmEnvFirmWasteService;

/**
 * 企业出渣Service业务层处理
 *
 * @author cjie
 * @date 2021-12-14
 */
@Service
public class OpmEnvFirmWasteServiceImpl implements IOpmEnvFirmWasteService {
    @Autowired
    private OpmEnvFirmWasteMapper opmEnvFirmWasteMapper;

    /**
     * 查询企业出渣
     *
     * @param id 企业出渣ID
     * @return 企业出渣
     */
    @Override
    public OpmEnvFirmWaste selectOpmEnvFirmWasteById(String id) {
        return opmEnvFirmWasteMapper.selectOpmEnvFirmWasteById(id);
    }

    /**
     * 查询企业出渣列表
     *
     * @param opmEnvFirmWaste 企业出渣
     * @return 企业出渣
     */
    @Override
    public List<OpmEnvFirmWaste> selectOpmEnvFirmWasteList(OpmEnvFirmWaste opmEnvFirmWaste) {
        return opmEnvFirmWasteMapper.selectOpmEnvFirmWasteList(opmEnvFirmWaste);
    }

    /**
     * 新增企业出渣
     *
     * @param opmEnvFirmWaste 企业出渣
     * @return 结果
     */
    @Override
    public int insertOpmEnvFirmWaste(OpmEnvFirmWaste opmEnvFirmWaste) {
        opmEnvFirmWaste.setId(IdUtil.getSnowflake(0, 0).nextIdStr());
        opmEnvFirmWaste.setCreateTime(DateUtils.getNowDate());
        opmEnvFirmWaste.setCreateBy(SecurityUtils.getUsername());
        return opmEnvFirmWasteMapper.insertOpmEnvFirmWaste(opmEnvFirmWaste);
    }

    /**
     * 修改企业出渣
     *
     * @param opmEnvFirmWaste 企业出渣
     * @return 结果
     */
    @Override
    public int updateOpmEnvFirmWaste(OpmEnvFirmWaste opmEnvFirmWaste) {
        return opmEnvFirmWasteMapper.updateOpmEnvFirmWaste(opmEnvFirmWaste);
    }

    /**
     * 批量删除企业出渣
     *
     * @param ids 需要删除的企业出渣ID
     * @return 结果
     */
    @Override
    public int deleteOpmEnvFirmWasteByIds(String[] ids) {
        return opmEnvFirmWasteMapper.deleteOpmEnvFirmWasteByIds(ids);
    }

    /**
     * 删除企业出渣信息
     *
     * @param id 企业出渣ID
     * @return 结果
     */
    @Override
    public int deleteOpmEnvFirmWasteById(String id) {
        return opmEnvFirmWasteMapper.deleteOpmEnvFirmWasteById(id);
    }
}
